package com.example.flowermall.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaoman
 * @since 2023-07-10
 */
@TableName("shopping_cart")
public class ShoppingCart implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 购物车ID
     */
    @TableId(value = "cart_id", type = IdType.AUTO)
    private Integer cartId;

    /**
     * 商品ID
     */
    private Integer productId;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 购物车商品数量
     */
    private Integer cartNum;
    @TableField(exist = false)
    private Boolean checked;

    /**
     * 添加购物车时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime cartTime;

    /**
     * 加入购物车时商品价格
     */
    private BigDecimal productPrice;
    @TableField(exist = false)
    private Product products;
    @TableField(exist = false)
    private String userName;

    public Integer getCartId() {
        return cartId;
    }

    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getCartNum() {
        return cartNum;
    }

    public void setCartNum(Integer cartNum) {
        this.cartNum = cartNum;
    }

    public LocalDateTime getCartTime() {
        return cartTime;
    }

    public void setCartTime(LocalDateTime cartTime) {
        this.cartTime = cartTime;
    }

    public BigDecimal getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(BigDecimal productPrice) {
        this.productPrice = productPrice;
    }

    public Product getProducts() {
        return products;
    }

    public void setProducts(Product products) {
        this.products = products;
    }

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}
